function login(){	// 登录检查
	if(form1.username.value===''){
		alert('用户名不能为空！');
		return false;
	}
	if(form1.password.value===''){
		alert('密码不能为空！');
		return false;
	}
	form1.submit();
}
window.onload = function(){	// 增加登录与重置按钮的事件监听
	var i2 = document.getElementsByClassName('input_2');
	for(var i=0;i<i2.length;i++){
		i2[i].onmouseover = function(){
			this.style.backgroundColor = "#23271F";
			this.style.color = "#fff";
		};
		i2[i].onmouseout = function(){
			this.style.backgroundColor = "#fff";
			this.style.color = "#23271F";
		}
	}
	var pass = document.getElementById("password");
	pass.onfocus = function(){
		pass.type = "password";
	}
};
document.onkeydown = function (e) {	// 增加事件监听，回车即登录
	if (!e) e = window.event;
	if ((e.keyCode || e.which) === 13) {
		login();
	}
};
function getDate(){	// 在times中嵌入时间
	var date = new Date();
	var date1 = date.toLocaleString();
	document.getElementById("times").innerHTML = "—— "+date1;
}
//使用定时器每秒向div写入当前时间
setInterval("getDate()",1000);